package com.epoint.mobileoa.ui.wsgw;

import java.util.Map;

import android.os.Message;

import com.epoint.mobileoa.R;
import com.epoint.mobileoa.bizlogic.NewTask;
import com.epoint.mobileoa.bizlogic.SuperView;
import com.epoint.mobileoa.tools.WebServiceUtilDAL;

/**
 * @author liyc
 * @time 2012-12-14 上午11:32:49
 * @annotation 调用Webservice获取公文流转列表
 */
public class GetDbListTask extends NewTask {

	/**
	 * @param sv
	 * @param taskID
	 * @param param
	 * @param progressMsg
	 * @param progressDialogType
	 */
	public GetDbListTask(SuperView sv, int taskID, Map<String, Object> param,
			String progressMsg, int progressDialogType) {
		super(sv, taskID, param, progressMsg, progressDialogType);
	}

	@Override
	public void exectue(Message mess) throws Exception {
		String url = sv.getString(R.string.gw_ws_url);
		String namespace = sv.getString(R.string.WS_namespace);

		String method = "Handle_GetUnHandleList";
		int CurrentPageIndex = (Integer) getParam().get("CurrentPageIndex");
		int PageSize = (Integer) getParam().get("PageSize");
		WebServiceUtilDAL webservice = new WebServiceUtilDAL(url,
				method, namespace);

		String ParasXml = "<?xml version=\"1.0\" encoding=\"gb2312\"?>"+
				"<paras>"+
				"<UserGuid>%s</UserGuid>"+
				"<KeyWord></KeyWord>"+
				"<HandleType></HandleType>"+
				"<CurrentPageIndex>%s</CurrentPageIndex>"+
				"<PageSize>%s</PageSize>"+
				"</paras>";
		
		ParasXml = String.format(ParasXml,getSv().fp.getUserguid(),CurrentPageIndex,PageSize);
		webservice.addProperty("ValidateData",getSv().getString(R.string.WS_ValidateData));
		webservice.addProperty("ParasXml",ParasXml);
		String bs = webservice.start();
		setMessageToRefreshUI(mess, bs);
	}

}
